package com.tiancheng.trade.settlement.mapper.settlement;

import com.tiancheng.trade.settlement.bo.ProductBO;
import com.tiancheng.trade.settlement.mapper.TYBaseMapper;
import com.tiancheng.trade.settlement.model.settlement.FlowSubOrder;
import com.tiancheng.trade.settlement.vo.settlement.api.FlowSubOrderVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FlowSubOrderMapper extends TYBaseMapper<FlowSubOrder> {

    /**
     * 按差异原因分组查询对应的订单差异金额
     */
    List<FlowSubOrderVO> getDiffAmount(@Param("date") String date);

    /**
     * 无合同报表信息
     * 按差异原因分组查询对应的订单差异金额
     */
    List<FlowSubOrderVO> getNoContractDiffAmount(@Param("date") String date);

    /**
     * 批量保存子订单信息
     */
    int saveBatch(List<FlowSubOrder> subs);

    /**
     * 更新子订单状态
     */
    int diffHandle(FlowSubOrder subs);

    int updateSubOrderProduct(ProductBO bo);
}
